<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends Action {
    public function index(){
		$this->display();
    }
	public function do_login(){
		$name=$_POST['name'];
		$password=$_POST['password'];
		$code=$_POST['code'];
		if($_SESSION['verify']!==md5($code)){
			$this->error('验证码错误！');
		}
		$m=M('User');
		$where['name']=$name;
		$where['password']=$password;
		$i=$m->where($where)->count();
		if($i>0){
			$this->redirect('User/index');
		}else{
			$this->error('该用户不存在');
		}
	}
}